package com.xxgc.zde;

import com.baomidou.mybatisplus.core.toolkit.AES;

/**
 * @Author:LYS
 * @Date: 2025/4/8 10:54
 * @Description:
 */
public class TestPassword {
    public static void main(String[] args) {
        String randomKey = "51082320040703ys";
        System.out.println("key="+randomKey);

        // 使用随机密钥加密
        String url = "jdbc:mysql://47.108.49.246:3306/zde?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC";
        String username = "root";
        String password = "20040703.lys";
        String urlEncrypted = AES.encrypt(url, randomKey);
        String usernameEncrypted = AES.encrypt(username, randomKey);
        String passwordEncrypted = AES.encrypt(password, randomKey);
        System.out.println("urlEncrypted="+urlEncrypted);
        System.out.println("usernameEncrypted="+usernameEncrypted);
        System.out.println("passwordEncrypted="+passwordEncrypted);
    }
}
